const InfoMy = require('../../../models/blog_info_my');


/**
 * 关于个人
 */
const ComtrolerMy = {
    getById: async function (req, res, next) {
        try {
            let { id } = req.query;
            const list = await InfoMy.select({ id });
            res.json({ code: 200, msg: '成功连接', data: list[0] })
        } catch (e) {
            res.json({ code: 0, data: e })
        }
    },

    update: async function (req, res, next) {
        try {
            let { id, content } = req.body;
            await InfoMy.update(id, { info: content });
            res.json({ code: 200, msg: '修改成功' })
        } catch (e) {
            res.json({ code: 0, data: e })
        }
    }
}

module.exports = ComtrolerMy;